package com.ourteam.product.ui.domain;
/**
 * Template Name : DTO数据对象 Template Version : 1 Template Last Modfiy Date : Fri Nov 30 16:49:33 CST
 * 2018 Auto Generate Date : 2018-12-14 15:15:49 Warning ! This file will be overwrite when
 * regenerate !
 */
import java.util.HashMap;
import java.util.Map;
import net.dao.IDataPopulateCallback;
import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

public class ProductUIFormLayoutDataBean implements java.io.Serializable {

  private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

  private com.ourteam.product.ui.dao.ProductUIFormLayoutData productUIFormLayoutData;

  protected BeanMap getBeanMap() {

    return new BeanMap(productUIFormLayoutData);
  }

  static {
    mappedDaoFields.put("id", com.ourteam.product.ui.dao.IProductUIFormLayoutDataDAO.Id);

    mappedDaoFields.put(
        "formFieldId", com.ourteam.product.ui.dao.IProductUIFormLayoutDataDAO.FormFieldId);

    mappedDaoFields.put("name", com.ourteam.product.ui.dao.IProductUIFormLayoutDataDAO.Name);

    mappedDaoFields.put("value", com.ourteam.product.ui.dao.IProductUIFormLayoutDataDAO.Value);
  }

  public static String getMappedDAOField(String aAttrName) {
    return mappedDaoFields.get(aAttrName);
  }

  public ProductUIFormLayoutDataBean() {
    super();

    this.productUIFormLayoutData = new com.ourteam.product.ui.dao.ProductUIFormLayoutData();
  }

  public ProductUIFormLayoutDataBean(
      com.ourteam.product.ui.dao.ProductUIFormLayoutData productUIFormLayoutData) {
    super();

    this.productUIFormLayoutData = productUIFormLayoutData;
  }

  public com.ourteam.product.ui.dao.ProductUIFormLayoutData convertToProductUIFormLayoutData() {
    return this.productUIFormLayoutData;
  }

  public com.ourteam.product.ui.dao.ProductUIFormLayoutData convertTo() {
    return this.productUIFormLayoutData;
  }

  /**
   * Get id
   *
   * @return long
   */
  public long getId() {
    return (long) this.productUIFormLayoutData.getId();
  }

  /**
   * Set id
   *
   * @parameter long
   */
  public void setId(long id) {

    this.productUIFormLayoutData.setId(id);
  }

  /**
   * Get formFieldId
   *
   * @return long
   */
  public long getFormFieldId() {
    return (long) this.productUIFormLayoutData.getFormFieldId();
  }

  /**
   * Set formFieldId
   *
   * @parameter long
   */
  public void setFormFieldId(long formFieldId) {

    this.productUIFormLayoutData.setFormFieldId(formFieldId);
  }

  /**
   * Get name
   *
   * @return String
   */
  public String getName() {
    return (String) this.productUIFormLayoutData.getName();
  }

  /**
   * Set name
   *
   * @parameter String
   */
  public void setName(String name) {

    this.productUIFormLayoutData.setName(name);
  }

  /**
   * Get value
   *
   * @return String
   */
  public String getValue() {
    return (String) this.productUIFormLayoutData.getValue();
  }

  /**
   * Set value
   *
   * @parameter String
   */
  public void setValue(String value) {

    this.productUIFormLayoutData.setValue(value);
  }

  public int hashCode() {
    return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
  }

  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    } // end if

    if ((obj instanceof ProductUIFormLayoutDataBean) == false) {
      return false;
    } // end if

    ProductUIFormLayoutDataBean other = (ProductUIFormLayoutDataBean) obj;

    boolean isEqual = false;

    com.ourteam.product.ui.dao.ProductUIFormLayoutData tempProductUIFormLayoutData =
        other.convertToProductUIFormLayoutData();

    if (tempProductUIFormLayoutData == null || this.productUIFormLayoutData == null) {
      isEqual = false;
    } else if (tempProductUIFormLayoutData == this.productUIFormLayoutData
        || tempProductUIFormLayoutData.equals(this.productUIFormLayoutData)) {
      isEqual = true;
    } else {
      isEqual = false;
    }

    return isEqual;
  }

  public static ProductUIFormLayoutDataBean[] toArray(
      com.ourteam.product.ui.dao.ProductUIFormLayoutData[] aProductUIFormLayoutDatas) {

    return toArray(aProductUIFormLayoutDatas, null);
  }

  public static ProductUIFormLayoutDataBean[] toArray(
      com.ourteam.product.ui.dao.ProductUIFormLayoutData[] aProductUIFormLayoutDatas,
      IDataPopulateCallback aCallBack) {

    if (ArrayUtils.isEmpty(aProductUIFormLayoutDatas)) {
      return new ProductUIFormLayoutDataBean[0];
    }

    int length = aProductUIFormLayoutDatas.length;

    ProductUIFormLayoutDataBean[] beans = new ProductUIFormLayoutDataBean[length];

    for (int i = 0; i < length; i++) {
      beans[i] = new ProductUIFormLayoutDataBean(aProductUIFormLayoutDatas[i]);
      if (aCallBack != null) {
        aCallBack.populate(beans[i], new Object[] {aProductUIFormLayoutDatas[i]});
      }
    }

    return beans;
  }
}
